﻿@using FCTC_Web.Utilities
@using DAL
@using FCTC_Web.Models
@model SessionUnit
@{
    ViewBag.Title = "风驰二手车";
}
  @Combres.HtmlExtensions.CombresLink("backjs")

  <script type="text/jscript">
      $(document).ready(function () {
          $("#divtTeamList").dialog({
              autoOpen: false,
              show: "drop",
              hide: "drop",
              height: 500,
              width: 470,
              modal: true,
              buttons: {
                  "确定": function () {
                  var $this = $(this);
                  var id = $this.find("li").attr('dataid');
                  var datavalue = target.find("li").attr('datavalue');
                  $("#LeftTeamID").val(id);
                  $("#leftTeamName").val(datavalue);
                      $this.dialog("close");

                  },
                  "取消": function () {
                      $(this).dialog("close");
                  }
              },
              close: function () {
              }
          });

          $("#btnAdjustTeams").click(function () {
              $("#divtTeamList").dialog("open");
          });
      });
    
  </script>
 @Html.ValidationSummary(true)
<fieldset>
    <legend>小组信息</legend>
    <div class="editor-label">
        @Html.LabelFor(model => model.UnitName)
    </div>
    <div class="editor-field">
        @Html.EditorFor(model => model.UnitName)
        @Html.ValidationMessageFor(model => model.UnitName)
    </div>

    <div class="editor-label">
        @Html.LabelFor(model => model.UnitType)
    </div>
    <div class="editor-field">
        @Html.DropDownListFor(model => model.UnitType, new SelectList(new List<string>{  
                      "第一轮", 
                      "第二轮", 
                      "第三轮",
                      "第四轮"
                        }), "--请选择--")
        @Html.ValidationMessageFor(model => model.UnitType)
    </div>
    <div class="editor-label">
        @Html.LabelFor(model => model.UnitStatus)
    </div>
    <div class="editor-field">
        @Html.DropDownListFor(model => model.UnitStatus, new SelectList(new List<string>{  
                      "未结束", 
                      "已结束"
                        }), "--请选择--")
        @Html.ValidationMessageFor(model => model.UnitStatus)
    </div>
         <div class="editor-label">
        @Html.LabelFor(model => model.TeamEnrollments, "队伍")
    </div>
    <div class="editor-field">
          <input type="button" id="btnAdjustTeams" value="调整小组队伍" />
          <div class="divDialog" id="divtTeamList">
            @Html.Partial(@"~\views\sessionunit\partial\teamlist.cshtml",Model)
        </div>
    </div>
</fieldset>
@Html.Partial(@"~\views\shared\controls\otherschange.cshtml", Model)
<p>
    <input type="submit" value="保存" />
</p>
@Html.ActionLink("回到列表", "Index")
